import useDictStore from '@/store/modules/dict'
import { listProjectExtend } from "@/api/mes/projectExtend";

// 查询客户管理列表
export function mesProject(dictType) {
  const res = ref({});
  return (() => {
    res.value[dictType] = [];
    listProjectExtend().then(resp => {
      //console.log(resp);
      res.value[dictType] = resp.data.map(project => ({ 
        value: project.projectId.toString(),
        label: project.projectName,
        person: project.companyPerson,
        elTagType: "default", elTagClass: null 
      }))
      useDictStore().setDict(dictType, res.value[dictType]);
    })
    //console.log(res);
    //console.log(toRefs(res.value));
    return toRefs(res.value);
  })()
}
